import Mock from 'mockjs';

export const roles = Mock.mock({
    'value|30': [
        {
            id: "@id",
            name: '管理员',
            code: "R_ADMIN",
        }
    ]
});
export const logs = Mock.mock({
    'value|50': [
        {
            'message|1': ["登录系统", "退出系统"],
            ip: "@ip",
            isException: '@boolean',
            created_at: "@datetime",
        }
    ]
});



export const user = Mock.mock({
    id: '@id',
    username: '@name',
    name: '@cname',
    avatar: '@dataImage("64x64")',
    'roles|1': ['管理员', '采购员'],
    status: 1,
    created_at: '@datetime("yyyy-MM-dd HH:mm:ss")',
    department: 'IT'
});

export const pumps = Mock.mock({
    "value|100": [
        {
            id: '@id',
            uuid: '@guid',
            "hospital|1": [
                '上海人民医院',
                '北京协和医院'
            ],
            "manufacturer|1": [
                '上海医疗器械',
                '北京医疗器械',
            ],
            "status|1": [9, 10],
            processed_at: '@datetime',
        }
    ]
});

export const pumpData = Mock.mock({
    "value|100": [
        {
            "year|+1": 1970,
            value: '@float(1, 50, 1, 2)',
        }
    ]
});

export const physicians = Mock.mock({
    "value|5": [
        {
            id: '@id',
            "status|1": ['等待解决', '服务中', '已解决'],
            name: '@cname',
        }
    ]
});


export const vendor = Mock.mock({
    "value|100": [
        {
            id: '@id',
            "name|1": [
                '上海医疗器械',
                '北京医疗器械',
                '上海医疗器械',
                '北京医疗器械',
            ],
            "status|1": [9, 10],
            created_at: '@datetime',
        }
    ]
});


export const alarms = Mock.mock({
    "value|100": [
        {
            id: '@id',
            user: '@cname', //来源患者
            "level|1": ['紧急', '高', '中', '低'],
            created_at: '@datetime',
            uuid: '@guid',
            "title|1": ['需补充药物', '药物过量', '错过注射时间', '失联'],
            "status|1": ['已处理', '未处理'],
        }
    ]
});